// 入口文件
import Vue from 'vue';



// 导入 Vuex 组件
import Vuex from 'vuex';
Vue.use(Vuex);

var store = new Vuex.Store({
    state: {
        count: 0
    },
    mutations: {
        increment(state) {
            state.count++;
        },
        subtract(state,obj) {
            state.count -= ( obj.c + obj.d );
        }
    },
    getters: {
        optCount: function(state) {
            return '当前最新得count值是：' + state.count ;
        }
    }
});



// 导入app
import App from './app.vue';
const vm = new Vue({
    el: '#app',
    render: c => c( App ),
    store
});








